{{ define "main" }}
<div class="container">
    <article>
        <header class="article-header">
            <div class="thumb">
                <div>
                    <h1>{{ .Title }}</h1>
                    <div class="post-meta">
                        <div>
                            {{ $author := .Params.author }}
                            {{ if eq $author nil }}
                              {{ $author = .Site.Params.author }}
                            {{ end }}
                            By {{ $author  }} | <time>{{ .Date.Format "2006-01-02" }}</time>
                            | {{ .ReadingTime }} minutes
                        </div>
                        <div class="tags">
                            {{ range (.GetTerms "tags") }}
                            <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
                            {{ end }}
                        </div>
                    </div>
                </div>
            </div>
        </header>
    </article>

    <div class="article-post">
    {{ .Content }}
    </div>
</div>

<div class="container">
    {{ if .Section }}
    <nav class="flex container suggested">
        {{ with .PrevInSection }}
        <a rel="prev" href="{{ .RelPermalink }}" title="Previous post (older)">
            <span>Previous</span>
            {{ .Title }}
            </a>
        {{ end }}
        
        {{ with .NextInSection }}
        <a rel="next" href="{{ .RelPermalink }}" title="Next post (newer)">
            <span>Next</span>
            {{ .Title }}
            </a> 
        {{ end }}
    </nav>
    {{ end }}
</div>
{{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}} 
<div class="container">
    {{ partial "comments/include" . }}
</div>
{{ end }}
</main>

{{ end }}
